package com.fesine.learn.design.principle.openclose;

/**
 * @description: 利用开闭原则扩展父类JavaCourse
 * @author: fesine
 * @createTime:2019/2/16
 * @update:修改内容
 * @author: fesine
 * @updateTime:2019/2/16
 */
public class JavaDiscountCourse extends JavaCourse{

    public JavaDiscountCourse(Integer id, String name, Double price) {
        super(id, name, price);
    }

    public Double getOriginPrice(){
        return super.getPrice();
    }

    /**
     * 原价进行8折优惠
     * @return
     */
    @Override
    public Double getPrice() {
        return super.getPrice()*0.8;
    }
}
